<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>变量运算</title>
    <script>
        function f1(){
            let num1 = 3;
            let num2 = 2;
            console.log(num1+"+"+num2+"="+(num1+num2));
            console.log(num1+"-"+num2+"="+(num1-num2));
            console.log(num1+"*"+num2+"="+(num1*num2));
            console.log(num1+"/"+num2+"="+(num1/num2));
            console.log(num1+"%"+num2+"="+(num1%num2));
            console.log(num1++);    // 3,num1的值是4
            console.log(++num2);    // 3
            console.log(num1+=1);   // num1 = num1 + 1 = 4 + 1 = 5
            console.log(num1 > num2 ? "大于" : "小于等于")
            console.log(num1 == 4 && num2 == 3);
            console.log(num1 == 4 || num2 == 3);
            console.log(2 == "2");
        }
        function f2(){
            let num = 2;
            let name = "2";
            console.log(num == name); // true
            // ===:表示比较两个变量值的同时比较此时两个变量的类型
            // 只有类型一致且值相同才会返回true
            // 只要有任意一个不同,则返回false
            console.log(num === name);
        }
        function f3(){
            console.log(2**3);
            console.log(2**-2);
            console.log(200**3);
        }
    </script>
</head>
<body>
<button onclick="f1()">基本运算</button><br>
<button onclick="f2()">恒等运算</button><br>
<button onclick="f3()">模方运算</button><br>
</body>
</html>